package com.ruoyi.common.core.utils.dsql;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * @Description
 * @Author YangJun
 * @Date 2021年10月26日 13:08:18
 **/
public class DsqlUtil {

    public static void main(String args[])
            throws Exception
    {
        Class.forName("com.mysql.cj.jdbc.Driver");
        String url = "jdbc:mysql://dsql.aliyuncs.com:3306?user=<xyzgyw_1817910108788473>&password=<XYzgyw123456>";
        Connection connection = DriverManager.getConnection(url);
        String sql = "SELECT * from asset_sys_ams_asms.asset_system.sys_user ";
        Statement stmt = connection.createStatement();
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            System.out.println(resultSet.getString("id"));
        }
        resultSet.close();
        stmt.close();
        connection.close();
    }
}
